package cn.swust.designpatternlearningplatform.domain.enums;

import lombok.Getter;

public enum TopicUpdateTypeEnum {
    SHIELD("shield"),
    WRONG("wrong"),
    COLLECT("collect");
    @Getter
    private final String typeName;

    TopicUpdateTypeEnum(String typeName) {
        this.typeName = typeName;
    }

    public static String topicUpdateType(Integer choice) {
        if (choice == null) {
            return null;
        }
        switch (choice) {
            case 0: {
                return SHIELD.getTypeName();
            }
            case 1: {
                return WRONG.getTypeName();
            }
            case 2: {
                return COLLECT.getTypeName();
            }
            default:
                return "null";
        }
    }
}
